package physicsModeler.objects;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.RenderingHints;
import java.awt.image.BufferedImage;

public class Soldier extends Sprite {
	
	

	public Soldier()
	{
		// imageFile defined in Sprite class
		
		rows = 1;
		cols = 11;
		width = 87;
		height = 100;
		
		sizeX= 100;
		sizeY = 100;
		
		imageFile = "images/Soldier.gif";
		image = loadImages();
		
	}
	
	public Soldier(int newSizeX, int newSizeY)
	{
		// imageFile defined in Sprite class
		
		rows = 1;
		cols = 11;
		width = 87;
		height = 100;
		
		sizeX= newSizeX;
		sizeY = newSizeY;
		
		imageFile = "images/Soldier.gif";
		image = loadImages();
		
	}
	
	public Soldier(int newPositionX,int newPositionY,int newSizeX, int newSizeY)
	{
		// imageFile defined in Sprite class
		
		rows = 1;
		cols = 11;
		width = 87;
		height = 100;
		
		sizeX= newSizeX;
		sizeY = newSizeY;
		
		positionX = newPositionX;
		positionY = newPositionY;
		
		imageFile = "images/Soldier.gif";
		image = loadImages();
		
	}
	
	public String getName()
	{
		return "Soldier";	
	}

	@Override
	public void draw(Graphics g) {
		// TODO Auto-generated method stub
		Graphics2D g2d = (Graphics2D) g;
	    RenderingHints hints = new RenderingHints(
	                                  RenderingHints.KEY_ANTIALIASING,
	                                  RenderingHints.VALUE_ANTIALIAS_ON);
	    g2d.addRenderingHints(hints);
		//g2d.drawOval(positionX, positionY, 50, 50);
	    
		try {
			 
			g2d.drawImage(sprites[0], positionX, positionY, null);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
	public void draw(Graphics g,int column) {
		// TODO Auto-generated method stub
		Graphics2D g2d = (Graphics2D) g;
	    RenderingHints hints = new RenderingHints(
	                                  RenderingHints.KEY_ANTIALIASING,
	                                  RenderingHints.VALUE_ANTIALIAS_ON);
	    g2d.addRenderingHints(hints);
		//g2d.drawOval(positionX, positionY, 50, 50);
	    
		try {
			g2d.drawImage(sprites[column], positionX, positionY, sizeX, sizeY,Color.black,imageObserver);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
}
